Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 54700c0deed43d1ab55a8814bdb4b400356f84ef


Parents : d8af183
Author : Sudo-Ivan <ivan@quad4.io>
Signature : Signature validation error
Date : 2026-01-01T23:36:52-06:00

feat(database): increment schema version to 20 and add notifications table with relevant indices

Changes

1 files changed, 33 insertions(+), 1 deletions(-)


Diff

diff --git a/meshchatx/src/backend/database/schema.py b/meshchatx/src/backend/database/schema.py
index 05852518..c24982b5 100644
--- a/meshchatx/src/backend/database/schema.py
+++ b/meshchatx/src/backend/database/schema.py
@@ -2,7 +2,7 @@ from .provider import DatabaseProvider
class DatabaseSchema:
- LATEST_VERSION = 19
+ LATEST_VERSION = 20
def __init__(self, provider: DatabaseProvider):
self.provider = provider
@@ -247,6 +247,18 @@ class DatabaseSchema:
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
)
""",
+ "notifications": """
+ CREATE TABLE IF NOT EXISTS notifications (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ type TEXT,
+ remote_hash TEXT,
+ title TEXT,
+ content TEXT,
+ is_viewed INTEGER DEFAULT 0,
+ timestamp REAL,
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP
+ )
+ """,
}
for table_name, create_sql in tables.items():
@@ -556,6 +568,26 @@ class DatabaseSchema:
"CREATE INDEX IF NOT EXISTS idx_call_history_remote_name ON call_history(remote_identity_name)",
)
+ if current_version < 20:
+ self.provider.execute("""
+ CREATE TABLE IF NOT EXISTS notifications (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ type TEXT,
+ remote_hash TEXT,
+ title TEXT,
+ content TEXT,
+ is_viewed INTEGER DEFAULT 0,
+ timestamp REAL,
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP
+ )
+ """)
+ self.provider.execute(
+ "CREATE INDEX IF NOT EXISTS idx_notifications_remote_hash ON notifications(remote_hash)",
+ )
+ self.provider.execute(
+ "CREATE INDEX IF NOT EXISTS idx_notifications_timestamp ON notifications(timestamp)",
+ )
+
# Update version in config
self.provider.execute(
"""


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────